@keyframes expand {
  0% {
    width: 0;
    height: 0;
  }
  100% {
    width: 200vmax;
    height: 200vmax;
  }
}

$timing-number: 500ms;

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes move-in {
  0% {
    transform: translateX(50%);

    width: 114px;
    height: 114px;
  }
  100% {
    transform: translateX(0);

    width: 64px;
    height: 64px;
  }
}

@keyframes move-up {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-50%);
  }
}

@keyframes move-down {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.App {
  user-select: none;
  -webkit-user-drag: none;
  -webkit-app-region: drag;
  position: relative;
  height: 100vh;
  width: 100vw;

  .close-btn {
    z-index: 100;
    position: absolute;
    right: 0;
    top: 0;
    -webkit-app-region: no-drag;
    padding: 0.5rem 1rem;
    color: #bfbfbf;

    &:hover {
      color: #777;

      &:active {
        color: #999;
      }
    }
  }

  .sense {
    height: 100vh;
    width: 100vw;
    display: flex;
    position: absolute;
    flex-direction: column;
    z-index: 10;
    justify-content: center;
    align-items: center;

    .headline {
      display: flex;
      align-items: center;

      .nanui-brand {
        opacity: 0;
        font-size: 54px;
        padding-bottom: 10px;

        > span {
          color: #c00;
          font-weight: normal;
        }
        animation: fade-in 1000ms ease $timing-number * 7 forwards alternate;
        transition: transform 500ms ease-in-out;
      }

      .nanui-logo {
        transform: translateX(50%);
        position: relative;
        width: 114px;
        height: 114px;
        margin: 0 10px;
        animation: move-in 500ms ease-in-out $timing-number * 6 forwards
          alternate;

        > div {
          position: absolute;
          width: 100%;
          height: 100%;
          background-repeat: no-repeat;
          background-size: contain;
        }
        .chrome-icon {
          background-image: url("./assets/chrome.png");
          z-index: 1;
          animation: fade-in 1000ms ease $timing-number * 4 forwards alternate;
          opacity: 0;
          transition: transform 500ms ease-in-out;
        }

        .window-icon {
          background-image: url("./assets/window.png");
          z-index: 0;
          margin-top: -3.5%;
          opacity: 0;
          animation: fade-in 1000ms ease $timing-number * 5 forwards alternate;
          transition: transform 500ms ease-in-out;
        }
      }

      @at-root .animation-complete &:hover {
        .nanui-logo {
          .chrome-icon {
            transform: translate(8px, 8px) scale(1.2);
          }

          .window-icon {
            transform: translate(-8px, -8px) scale(1.05);
          }
        }

        .nanui-brand {
          transform: translate(15px, -10px) scale(1.1);
        }
      }
    }

    .slogan {
      color: #666;
      margin: 0.5rem 0;
      font-size: 16px;
      opacity: 0;
      text-align: center;

      animation: fade-in 3000ms ease-in-out $timing-number * 7.5 forwards
        alternate;

      &:hover {
        text-decoration: underline;
      }
    }

    .buttons {
      opacity: 0;
      transform: translateY(16vh);
      height: 64px;
      width: 64px;
      position: relative;

      animation: fade-in 500ms cubic-bezier(0.21, 0.62, 0.32, 0.97)
        $timing-number * 8 forwards alternate;

      > div {
        width: 64px;
        height: 64px;
        position: absolute;
      }
      div.start-btn {
        z-index: 10;
        -webkit-app-region: no-drag;

        transition: all ease-in-out 200ms;

        font-size: 40px;
        color: #999;
        display: flex;

        .icon {
          fill: #666;
        }

        > span {
          margin: 0 0.5rem;
        }

        opacity: 0.7;

        &:hover {
          opacity: 0.8;
          transform: scale(1.1);

          &:active {
            opacity: 0.6;
          }
        }
      }
      @keyframes halo {
        0% {
          opacity: 0;
          transform: scale(1);
        }
        30% {
          opacity: 1;
          transform: scale(1);
          border-width: 1px;
        }
        90% {
          opacity: 0;
          transform: scale(2);
          border-width: 5px;
        }
        100% {
          opacity: 0;
        }
      }

      div.btn-halo {
        box-sizing: border-box;
        width: 64px;
        height: 64px;
        border-radius: 50%;
        border: solid 1px #ebebeb;
        animation: halo 1500ms cubic-bezier(0.21, 0.62, 0.32, 0.97) infinite
          forwards;
      }
    }
  }

  .animate-squre {
    position: absolute;
    animation-name: expand;
    animation-timing-function: ease-out;
    animation-direction: alternate;
    animation-fill-mode: forwards;
    animation-duration: $timing-number;
    border-radius: 50%;

    &.one {
      background-color: #dd493d;
      top: -50vmax;
      left: -50vmax;
      animation-delay: $timing-number;
    }

    &.two {
      background-color: #fdce4a;
      top: -50vmax;
      right: -50vmax;
      animation-delay: $timing-number * 1.5;
    }

    &.three {
      background-color: #109d59;
      bottom: -50vmax;
      left: -50vmax;
      animation-delay: $timing-number * 2;
    }

    &.four {
      background-color: #4787f3;
      bottom: -50vmax;
      right: -50vmax;
      animation-delay: $timing-number * 2.5;
    }

    &.five {
      background-color: #ffffff;
      top: -50vmax;
      left: -50vmax;
      animation-delay: $timing-number * 3;
    }
  }
}
